home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-08 | 1.6 KB | 58 lines | [TEXT/GEOL] |
- Item forwarded by FRED.FORSMAN to SEAGRAVES3
-
- Item 8339577 2-June-90 21:56PDT
-
- From: TERRAN Cyberex, Terran Van Wagner,PRT
-
- To: MACDTS Macintosh Developer Tech Supt
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: codegen chokes obj/rec fields
-
- There's a problem w/ register usage for Record/Object field dereferencing.
- The code came out of a very small method, there were no WITH's around these
- lines.
- Pascal 3.1 was the compiler.
-
- The error:
- ### Register 8..10
- ### Within TCHROMVIEW_BOUNDINGPTTOVIEW (Error 2001): Expression too
- complicated, code generator ran out of registers
- ### IC = 128, IN = 84:166
-
- Function's args:
- (BoundingPt : VPoint; VAR ViewPt : VPoint)
-
- Relevant types:
- fNegOffset : LongInt;
- fVertZoom : extended;
- li : longint;
- extra : extended;
-
- Binary searching led me to this line:
-
- A: ViewPt.v := Num2Longint(fVertZoom * (BoundingPt.v - fNegOffset));
- { killed codegen }
-
- I started by simplifying the math, but that didn't do:
-
- li := BoundingPt.v - fNegOffset;
- B: ViewPt.v := Num2Longint(fVertZoom * li); } { <- This enough to kill?}
-
- I decided the problem was too much address indirection,
- but a few iterations later this made it past the compiler:
-
- C: extra := fVertZoom * (BoundingPt.v - fNegOffset); { <- but this went }
- ViewPt.v := Num2Longint(extra);
-
- So, I'd guess that A needs address registers for 4 elements, and B
- enough for 2 elements. However C, which the compiler managed, required 3!
-
- What's going on here?
-
- Thanks,
-
- Terran Van Wagner, A'link TERRAN
-
-